package com.qny.ai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qny.ai.dto.role.RoleCreateRequest;
import com.qny.ai.dto.role.RoleUpdateRequest;
import com.qny.ai.entity.AppRole;
import com.qny.ai.entity.RoleRating;

import java.util.List;

public interface RoleService {
    Long createRole(Long creatorId, RoleCreateRequest request);
    boolean updateRole(RoleUpdateRequest request);
    AppRole getById(Long id);
    boolean deleteById(Long id);
    Page<AppRole> pageList(int pageNo, int pageSize, String keyword);
    Page<AppRole> search(String keyword, String status, String privacy, String sortBy, boolean asc, int pageNo, int pageSize);
    boolean incrementUsage(Long roleId);
    Page<AppRole> getMyRoles(Long creatorId, int pageNo, int pageSize);
    
    List<AppRole> getHotRoles();
    
    Page<AppRole> getFavoriteRoles(Long userId, int pageNo, int pageSize);
    
    boolean publishRole(Long roleId, Long userId);
    
    boolean unpublishRole(Long roleId, Long userId);
    
    Page<AppRole> searchRoles(String keyword, String status, String privacy, String category, String sortBy, Boolean asc, int pageNo, int pageSize);
    
    AppRole getPublicRole(Long roleId);
    
    boolean toggleFavorite(Long roleId, Long userId);
    
    List<RoleRating> getRoleReviews(Long roleId, int pageNo, int pageSize);
    
    boolean addRoleRating(Long roleId, Long userId, Integer rating, String comment);
    
    boolean updateRoleRating(Long ratingId, Long userId, Integer rating, String comment);
    
    boolean deleteRoleRating(Long ratingId, Long userId);
}


